/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.staf.NetworkReportGenerator;

import java.util.LinkedHashMap;
import java.util.Iterator;
import java.util.Collection;

/**
 *
 * @author aezhov
 */
public class CrossSwitchCalculator {
    Switch rootSwitch = null;

    public CrossSwitchCalculator(LinkedHashMap<String, Switch> swList,
            String monitorStationMAC)
    {
        Collection switches = swList.values();

        // Step 1. Find root switch - switch the monitoring station connected to
        Iterator<Switch> swIt = switches.iterator();
        while (swIt.hasNext()) {
            Switch sw = swIt.next();
            if (sw.isRoot(monitorStationMAC)) {
                System.out.println("ROOT SWITCH FOUND " + sw.name);
                rootSwitch = sw;
            }
        }

    }
}
